package com.yida.gwj.config.mapper;

import com.yida.common.datasource.annotation.Master;
import com.yida.common.datasource.annotation.Slave;
import com.yida.gwj.common.domain.dto.GwjUserDTO;
import com.yida.gwj.config.domain.dto.GwjBusinessFlowDTO;
import com.yida.gwj.config.domain.dto.GwjBusinessLogDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Author: PPV
 * @Date: 2023-02-24
 */
@Mapper
public interface GwjBusinessCommonMapper {

    /**
     * 获取业务当前流程
     *
     * @param bizId
     * @param tableName
     * @return
     */
    @Master
    GwjBusinessFlowDTO getFlow(@Param("bizId") Long bizId, @Param("tableName") String tableName);

    /**
     * 获取前一个提交用户
     *
     * @param paramMap
     * @return
     */
    @Master
    GwjUserDTO getPreviousSubmitUser(@Param("paramMap") Map<String, Object> paramMap);

    /**
     * 获取日志
     *
     * @param bizId
     * @param tableName
     * @return
     */
    @Master
    List<GwjBusinessLogDTO> getLog(@Param("bizId") Long bizId, @Param("tableName") String tableName);


    /**
     * 获取外网业务当前流程
     *
     * @param bizId
     * @param tableName
     * @return
     */
    @Slave
    GwjBusinessFlowDTO getOutFlow(@Param("bizId") Long bizId, @Param("tableName") String tableName);

    /**
     * 获取外网前一个提交用户
     *
     * @param paramMap
     * @return
     */
    @Slave
    GwjUserDTO getOutPreviousSubmitUser(@Param("paramMap") Map<String, Object> paramMap);

    /**
     * 获取外网日志
     *
     * @param bizId
     * @param tableName
     * @return
     */
    @Slave
    List<GwjBusinessLogDTO> getOutLog(@Param("bizId") Long bizId, @Param("tableName") String tableName);
}
